package com.xixi.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xixi.model.domain.User;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author dell
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2024-09-09 14:12:24
*/
public interface UserService extends IService<User> {

	/**
	 * 用户注册
	 * @author zxh
	 * @param userAccount 账户
	 * @param userPassword 密码
	 * @param checkPassword 校验密码
	 * @return 返回注册成功的用户id
	 * @CreateDate 2024/9/9
	 * @UpdateLog 2024/9/9 - []
	 */
	long userRegister(String userAccount, String userPassword, String checkPassword);

	/**
	 * 用户登录
	 *
	 * @param userAccount  账户
	 * @param userPassword 密码
	 * @param request
	 * @return 返回用户的脱敏信息
	 * @author zxh
	 * @CreateDate 2024/9/11
	 * @UpdateLog 2024/9/11 - []
	 */
	User doLogin(String userAccount, String userPassword, HttpServletRequest request);

	/**
	 * 查询用户
	 * @author zxh
	 * @param username 用户名
	 * @param request
	 * @return 返回用户列表
	 * @CreateDate 2024/9/11
	 * @UpdateLog 2024/9/11 - []
	 */
	List<User> searchUser(String username, HttpServletRequest request);

	/**
	 * 删除用户
	 * @author zxh
	 * @param userId 用户id
	 * @param request
	 * @return
	 * @CreateDate 2024/9/11
	 * @UpdateLog 2024/9/11 - []
	 */
	Boolean deleteUser(Long userId, HttpServletRequest request);
}
